package com.yunkeji.admin.controller.broker;

import com.yunkeji.common.core.controller.BaseController;
import com.yunkeji.common.core.domain.PageQuery;
import com.yunkeji.common.core.page.TableDataInfo;
import com.yunkeji.dao.vo.StatisticsVo;
import com.yunkeji.dao.vo.broker.IndexVo;
import com.yunkeji.dao.vo.broker.InviteInfoVo;
import com.yunkeji.system.domain.bo.InviteInfoBo;
import com.yunkeji.system.domain.bo.MonthStatisticsBo;
import com.yunkeji.system.domain.bo.StatisticsBo;
import com.yunkeji.system.service.IAppUserService;
import com.yunkeji.system.service.IPayDetailService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 推广统计
 *
 * @author 雷擎宇
 * @date 2024-11-26
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/broker")
public class BrokerController extends BaseController {

    private final IAppUserService appUserService;
    private final IPayDetailService payDetailService;


    /** 查询邀请统计 */
    @GetMapping("/statistics")
    public TableDataInfo<StatisticsVo> statistics(StatisticsBo bo, PageQuery pageQuery) {
        return payDetailService.queryInviteStatistics(bo, pageQuery);
    }

    /** 查询邀请信息 */
    @GetMapping("/info")
    public TableDataInfo<InviteInfoVo> info(InviteInfoBo bo, PageQuery pageQuery) {
        return payDetailService.queryInviteInfo(bo, pageQuery);
    }

    /** 查询首页统计 */
    @GetMapping("/index")
    public TableDataInfo<IndexVo> index(MonthStatisticsBo bo, PageQuery pageQuery) {
        return appUserService.queryRegisterCount(bo, pageQuery);
    }
}
